package com.shrct.businessprocess.budget.impl;

import com.google.common.base.Objects;
import com.shrct.businessprocess.budget.RCBudget;
import com.shrct.businessprocess.budget.RCCostBreakDown;
import com.shrct.businessprocess.budget.RCHasCostBudget;
import com.shrct.businessprocess.budget.RCHasCostBudgetPayProcess;
import com.shrct.businessprocess.budget.RCHasCostBudgetPayRequest;
import com.shrct.businessprocess.budget.impl.RCHasCostBudgetImpl;
import com.shrct.businessprocess.budget.impl.RCHasCostBudgetPayRequestImpl;
import com.shrct.businessprocess.budget.proxy.RCHasCostBudgetPayProcessProxy;
import com.shrct.businessprocess.organization.RCCEORoleProvider;
import com.shrct.businessprocess.organization.RCEmployee;
import com.shrct.businessprocess.organization.RCFinanceLeaderRoleProvider;
import com.shrct.businessprocess.organization.RCFinanceManRoleProvider;
import com.shrct.businessprocess.organization.impl.RCEmployeeImpl;
import com.shrct.businessprocess.project.RCProject;
import com.shrct.businessprocess.project.RCProjectMoney;
import com.shrct.businessprocess.project.RCProjectProcessEvent;
import com.shrct.businessprocess.project.RCProjectProcessEventStatus;
import com.shrct.businessprocess.project.RCProjectStat;
import com.shrct.businessprocess.project.RCRealMoney;
import com.shrct.businessprocess.project.impl.RCProjectProcessEventImpl;
import com.uniquesoft.uidl.validation.Validates;
import edu.fudan.langlab.domain.organization.Party;
import edu.fudan.langlab.domain.security.ISystemUserService;
import edu.fudan.langlab.domain.workflow.ActivityNodeDef;
import edu.fudan.langlab.domain.workflow.BusinessProcess;
import edu.fudan.langlab.domain.workflow.Token;
import edu.fudan.langlab.domain.workflow.impl.BusinessProcessImpl;
import edu.fudan.mylang.pf.IGenericQuery;
import edu.fudan.mylang.pf.IObjectFactory;
import edu.fudan.mylang.utils.DateUtil;
import java.util.Date;
import javax.persistence.CascadeType;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import org.eclipse.xtext.xbase.lib.ObjectExtensions;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.eclipse.xtext.xbase.lib.StringExtensions;
import org.springframework.beans.factory.BeanFactory;

@Entity
@DiscriminatorValue("RCHASCOSTBUDGETPAYPROCESS_TYPE")
public class RCHasCostBudgetPayProcessImpl extends BusinessProcessImpl implements RCHasCostBudgetPayProcess {
  public RCHasCostBudgetPayProcessImpl() {
    super();
  }
  
  public String getProcessName() {
    return "预算项付款流程";
  }
  
  public String getProcessType() {
    return "RCHasCostBudgetPayProcess";
  }
  
  public ActivityNodeDef getActivityDef(final String activityId) {
    edu.fudan.langlab.domain.workflow.ActivityNodeDef result = new edu.fudan.langlab.domain.workflow.ActivityNodeDef();
    result.setActivityId(activityId);
    if("__end__".equals(activityId)){
    	result.setDescription("end");
    }else
    	result.setDescription(Enum.valueOf(com.shrct.businessprocess.budget.RCHasCostBudgetPayProcessStatus.class, activityId).toString());
    return result;
    
  }
  
  public void _start(final RCProjectMoney amount, final RCHasCostBudget budget, final String comment, final Token token) {
    BeanFactory _beanFactory = this.getBeanFactory();
    ISystemUserService _bean = _beanFactory.<ISystemUserService>getBean(ISystemUserService.class);
    Party _currentUserAsParty = _bean.getCurrentUserAsParty();
    this.starter = ((RCEmployee) _currentUserAsParty);
    this.budget = budget;RCHasCostBudgetPayRequest rCHasCostBudgetPayRequest=RCHasCostBudgetPayRequestImpl.create(budget,getObjectFactory());
    final Procedure1<RCHasCostBudgetPayRequest> _function = new Procedure1<RCHasCostBudgetPayRequest>() {
        public void apply(final RCHasCostBudgetPayRequest it) {
          it.setAmount(amount);
          it.setComment(comment);
          it.setThebudget(((RCBudget) budget));
          Date _date = new Date();
          it.setTheStartDate(_date);
        }
      };
    RCHasCostBudgetPayRequest _doubleArrow = ObjectExtensions.<RCHasCostBudgetPayRequest>operator_doubleArrow(rCHasCostBudgetPayRequest, _function);
    this.payRequest = _doubleArrow;
    RCHasCostBudget _budget = this.payRequest.getBudget();
    RCCostBreakDown _cbd = _budget.getCbd();
    RCProject _project = _cbd.getProject();RCProjectProcessEvent rCProjectProcessEvent=RCProjectProcessEventImpl.create(_project,getObjectFactory());
    final Procedure1<RCProjectProcessEvent> _function_1 = new Procedure1<RCProjectProcessEvent>() {
        public void apply(final RCProjectProcessEvent it) {
          it.setBp(((BusinessProcess) RCHasCostBudgetPayProcessImpl.this));
          it.setStatus(RCProjectProcessEventStatus.executing);
          RCHasCostBudget _budget = RCHasCostBudgetPayProcessImpl.this.payRequest.getBudget();
          String _entityName = _budget.getEntityName();
          String _plus = ("\u7533\u8BF7\u4ED8\u6B3E,\u4ED8\u6B3E\u79D1\u76EE" + _entityName);
          String _plus_1 = (_plus + ",\u8BF7\u6C42\u91D1\u989D:");
          RCProjectMoney _amount = RCHasCostBudgetPayProcessImpl.this.payRequest.getAmount();
          String _string = _amount.toString();
          String _plus_2 = (_plus_1 + _string);
          it.setDescription(_plus_2);
          Date _day = DateUtil.today();
          it.setDate(_day);
        }
      };
    ObjectExtensions.<RCProjectProcessEvent>operator_doubleArrow(rCProjectProcessEvent, _function_1);
  }
  
  public void start(final RCProjectMoney amount, final RCHasCostBudget budget, final String comment) {
    edu.fudan.langlab.domain.workflow.Token token = getProcessManager().start(this,com.shrct.businessprocess.budget.RCHasCostBudgetPayProcessStatus.businessManAudit.name());
    _start(amount,budget,comment,token);
    getProcessManager().registTask(this, token, businessMan(),getBusinessManAudit_task_message());
    systemExecute();
    String msg = getStart_log_message(amount,budget,comment);
    getProcessManager().createActivity(this,"Create Process",msg);
    
    
  }
  
  public String getStart_log_message(final RCProjectMoney amount, final RCHasCostBudget budget, final String comment) {
    return "\u542F\u52A8\u4ED8\u6B3E\u6D41\u7A0B";
  }
  
  public void modify() {
  }
  
  public void _modify_cancel(final String comment, final Token token) {
    Token __end___token = getProcessManager().forwardTo(token,"__end__");
    
  }
  
  public void modify_cancel(final String comment) {
    edu.fudan.langlab.domain.workflow.Token token = getProcessManager().assertToken(this,com.shrct.businessprocess.budget.RCHasCostBudgetPayProcessStatus.modify.name());
    _modify_cancel(comment,token);
    systemExecute();
    String msg = getModify_Cancel_log_message(comment);
    getProcessManager().createActivity(this,"销售修改付款内容.销售取消付款申请",msg);
    
    
  }
  
  public String getModify_Cancel_log_message(final String comment) {
    String _xifexpression = null;
    boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(comment);
    if (_isNullOrEmpty) {
      _xifexpression = "";
    } else {
      String _plus = (",\u5907\u6CE8:" + comment);
      _xifexpression = _plus;
    }
    String _plus_1 = ("\u9500\u552E\u53D6\u6D88\u4ED8\u6B3E\u7533\u8BF7" + _xifexpression);
    return _plus_1;
  }
  
  public void _modify_modify(final String comment, final Token token) {
    Token businessManAudit_token = getProcessManager().forwardTo(token,com.shrct.businessprocess.budget.RCHasCostBudgetPayProcessStatus.businessManAudit.name());
    getProcessManager().registTask(this, businessManAudit_token,businessMan(),getBusinessManAudit_task_message());
  }
  
  public void modify_modify(final String comment) {
    edu.fudan.langlab.domain.workflow.Token token = getProcessManager().assertToken(this,com.shrct.businessprocess.budget.RCHasCostBudgetPayProcessStatus.modify.name());
    _modify_modify(comment,token);
    systemExecute();
    String msg = getModify_Modify_log_message(comment);
    getProcessManager().createActivity(this,"销售修改付款内容.销售修改付款信息",msg);
    
    
  }
  
  public String getModify_Modify_log_message(final String comment) {
    String _xifexpression = null;
    boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(comment);
    if (_isNullOrEmpty) {
      _xifexpression = "";
    } else {
      String _plus = (",\u5907\u6CE8:" + comment);
      _xifexpression = _plus;
    }
    String _plus_1 = ("\u9500\u552E\u5B8C\u6210\u4ED8\u6B3E\u7533\u8BF7\u4FEE\u6539" + _xifexpression);
    return _plus_1;
  }
  
  public String getModify_task_message() {
    String _entityName = this.budget.getEntityName();
    String _plus = ("\u4ED8\u6B3E\u9884\u7B97\u9879:" + _entityName);
    return _plus;
  }
  
  public void businessManAudit() {
  }
  
  public void _businessManAudit_agree(final String comment, final Token token) {
    Token ceoAudit_token = getProcessManager().forwardTo(token,com.shrct.businessprocess.budget.RCHasCostBudgetPayProcessStatus.ceoAudit.name());
    getProcessManager().registTask(this, ceoAudit_token,ceo(),getCeoAudit_task_message());
  }
  
  public void businessManAudit_agree(final String comment) {
    edu.fudan.langlab.domain.workflow.Token token = getProcessManager().assertToken(this,com.shrct.businessprocess.budget.RCHasCostBudgetPayProcessStatus.businessManAudit.name());
    _businessManAudit_agree(comment,token);
    systemExecute();
    String msg = getBusinessManAudit_Agree_log_message(comment);
    getProcessManager().createActivity(this,"商务审核.商务审核通过",msg);
    
    
  }
  
  public String getBusinessManAudit_Agree_log_message(final String comment) {
    String _xifexpression = null;
    boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(comment);
    if (_isNullOrEmpty) {
      _xifexpression = "";
    } else {
      String _plus = (",\u5907\u6CE8:" + comment);
      _xifexpression = _plus;
    }
    String _plus_1 = ("\u5546\u52A1\u5BA1\u6838\u901A\u8FC7" + _xifexpression);
    return _plus_1;
  }
  
  public void _businessManAudit_refuse(final String comment, final Token token) {
    Token modify_token = getProcessManager().forwardTo(token,com.shrct.businessprocess.budget.RCHasCostBudgetPayProcessStatus.modify.name());
    getProcessManager().registTask(this, modify_token,saler(),getModify_task_message());
  }
  
  public void businessManAudit_refuse(final String comment) {
    edu.fudan.langlab.domain.workflow.Token token = getProcessManager().assertToken(this,com.shrct.businessprocess.budget.RCHasCostBudgetPayProcessStatus.businessManAudit.name());
    _businessManAudit_refuse(comment,token);
    systemExecute();
    String msg = getBusinessManAudit_Refuse_log_message(comment);
    getProcessManager().createActivity(this,"商务审核.商务拒绝",msg);
    
    
  }
  
  public String getBusinessManAudit_Refuse_log_message(final String comment) {
    String _xifexpression = null;
    boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(comment);
    if (_isNullOrEmpty) {
      _xifexpression = "";
    } else {
      String _plus = (",\u5907\u6CE8:" + comment);
      _xifexpression = _plus;
    }
    String _plus_1 = ("\u5546\u52A1\u62D2\u7EDD" + _xifexpression);
    return _plus_1;
  }
  
  public String getBusinessManAudit_task_message() {
    String _entityName = this.budget.getEntityName();
    String _plus = ("\u4ED8\u6B3E\u9884\u7B97\u9879:" + _entityName);
    return _plus;
  }
  
  public void ceoAudit() {
  }
  
  public void _ceoAudit_agree(final String comment, final Token token) {
    Token financeLeaderAudit_token = getProcessManager().forwardTo(token,com.shrct.businessprocess.budget.RCHasCostBudgetPayProcessStatus.financeLeaderAudit.name());
    getProcessManager().registTask(this, financeLeaderAudit_token,financeLeader(),getFinanceLeaderAudit_task_message());
  }
  
  public void ceoAudit_agree(final String comment) {
    edu.fudan.langlab.domain.workflow.Token token = getProcessManager().assertToken(this,com.shrct.businessprocess.budget.RCHasCostBudgetPayProcessStatus.ceoAudit.name());
    _ceoAudit_agree(comment,token);
    systemExecute();
    String msg = getCeoAudit_Agree_log_message(comment);
    getProcessManager().createActivity(this,"总经理审核.总经理同意",msg);
    
    
  }
  
  public String getCeoAudit_Agree_log_message(final String comment) {
    String _xifexpression = null;
    boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(comment);
    if (_isNullOrEmpty) {
      _xifexpression = "";
    } else {
      String _plus = (",\u5907\u6CE8:" + comment);
      _xifexpression = _plus;
    }
    String _plus_1 = ("\u603B\u7ECF\u7406\u540C\u610F" + _xifexpression);
    return _plus_1;
  }
  
  public void _ceoAudit_refuse(final String comment, final Token token) {
    Token businessManAudit_token = getProcessManager().forwardTo(token,com.shrct.businessprocess.budget.RCHasCostBudgetPayProcessStatus.businessManAudit.name());
    getProcessManager().registTask(this, businessManAudit_token,businessMan(),getBusinessManAudit_task_message());
  }
  
  public void ceoAudit_refuse(final String comment) {
    edu.fudan.langlab.domain.workflow.Token token = getProcessManager().assertToken(this,com.shrct.businessprocess.budget.RCHasCostBudgetPayProcessStatus.ceoAudit.name());
    _ceoAudit_refuse(comment,token);
    systemExecute();
    String msg = getCeoAudit_Refuse_log_message(comment);
    getProcessManager().createActivity(this,"总经理审核.总经理不同意",msg);
    
    
  }
  
  public String getCeoAudit_Refuse_log_message(final String comment) {
    String _xifexpression = null;
    boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(comment);
    if (_isNullOrEmpty) {
      _xifexpression = "";
    } else {
      String _plus = (",\u5907\u6CE8:" + comment);
      _xifexpression = _plus;
    }
    String _plus_1 = ("\u603B\u7ECF\u7406\u4E0D\u540C\u610F" + _xifexpression);
    return _plus_1;
  }
  
  public String getCeoAudit_task_message() {
    String _entityName = this.budget.getEntityName();
    String _plus = ("\u4ED8\u6B3E\u9884\u7B97\u9879:" + _entityName);
    return _plus;
  }
  
  public void financeLeaderAudit() {
  }
  
  public void _financeLeaderAudit_agree(final String comment, final Token token) {
    Token financeManPay_token = getProcessManager().forwardTo(token,com.shrct.businessprocess.budget.RCHasCostBudgetPayProcessStatus.financeManPay.name());
    getProcessManager().registTask(this, financeManPay_token,financeMan(),getFinanceManPay_task_message());
  }
  
  public void financeLeaderAudit_agree(final String comment) {
    edu.fudan.langlab.domain.workflow.Token token = getProcessManager().assertToken(this,com.shrct.businessprocess.budget.RCHasCostBudgetPayProcessStatus.financeLeaderAudit.name());
    _financeLeaderAudit_agree(comment,token);
    systemExecute();
    String msg = getFinanceLeaderAudit_Agree_log_message(comment);
    getProcessManager().createActivity(this,"财务经理审核.财务经理同意",msg);
    
    
  }
  
  public String getFinanceLeaderAudit_Agree_log_message(final String comment) {
    String _xifexpression = null;
    boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(comment);
    if (_isNullOrEmpty) {
      _xifexpression = "";
    } else {
      String _plus = (",\u5907\u6CE8:" + comment);
      _xifexpression = _plus;
    }
    String _plus_1 = ("\u8D22\u52A1\u7ECF\u7406\u540C\u610F" + _xifexpression);
    return _plus_1;
  }
  
  public void _financeLeaderAudit_refuse(final String comment, final Token token) {
    Token ceoAudit_token = getProcessManager().forwardTo(token,com.shrct.businessprocess.budget.RCHasCostBudgetPayProcessStatus.ceoAudit.name());
    getProcessManager().registTask(this, ceoAudit_token,ceo(),getCeoAudit_task_message());
  }
  
  public void financeLeaderAudit_refuse(final String comment) {
    edu.fudan.langlab.domain.workflow.Token token = getProcessManager().assertToken(this,com.shrct.businessprocess.budget.RCHasCostBudgetPayProcessStatus.financeLeaderAudit.name());
    _financeLeaderAudit_refuse(comment,token);
    systemExecute();
    String msg = getFinanceLeaderAudit_Refuse_log_message(comment);
    getProcessManager().createActivity(this,"财务经理审核.财务经理不同意",msg);
    
    
  }
  
  public String getFinanceLeaderAudit_Refuse_log_message(final String comment) {
    String _xifexpression = null;
    boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(comment);
    if (_isNullOrEmpty) {
      _xifexpression = "";
    } else {
      String _plus = (",\u5907\u6CE8:" + comment);
      _xifexpression = _plus;
    }
    String _plus_1 = ("\u8D22\u52A1\u7ECF\u7406\u4E0D\u540C\u610F" + _xifexpression);
    return _plus_1;
  }
  
  public String getFinanceLeaderAudit_task_message() {
    String _entityName = this.budget.getEntityName();
    String _plus = ("\u4ED8\u6B3E\u9884\u7B97\u9879:" + _entityName);
    return _plus;
  }
  
  public void financeManPay() {
  }
  
  public void _financeManPay_agree(final String comment, final Token token) {
    this.payRequest.setIsFinished(Boolean.valueOf(true));
    final BusinessProcess thisBp = ((BusinessProcess) this);
    IGenericQuery<RCProjectProcessEvent> query=getObjectFactory().createGenericQuery(RCProjectProcessEvent.class,"select e from com.shrct.businessprocess.project.impl.RCProjectProcessEventImpl as e   where ((e.bp) = (:thisBp)) and  e.active = 1      ").setParameter("thisBp",thisBp);
    final RCProjectProcessEvent event = query.uniqueResult();
    final Procedure1<RCProjectProcessEvent> _function = new Procedure1<RCProjectProcessEvent>() {
        public void apply(final RCProjectProcessEvent it) {
          RCHasCostBudget _budget = RCHasCostBudgetPayProcessImpl.this.payRequest.getBudget();
          String _entityName = _budget.getEntityName();
          String _plus = ("\u5B8C\u6210\u4ED8\u6B3E,\u4ED8\u6B3E\u79D1\u76EE" + _entityName);
          String _plus_1 = (_plus + ",\u4ED8\u6B3E\u91D1\u989D:");
          RCRealMoney _totalPaidAmount = RCHasCostBudgetPayProcessImpl.this.payRequest.getTotalPaidAmount();
          String _string = _totalPaidAmount.toString();
          String _plus_2 = (_plus_1 + _string);
          it.setDescription(_plus_2);
          Date _day = DateUtil.today();
          it.setFinishDate(_day);
          it.setStatus(RCProjectProcessEventStatus.finished);
        }
      };
    ObjectExtensions.<RCProjectProcessEvent>operator_doubleArrow(event, _function);
    RCHasCostBudget _budget = this.payRequest.getBudget();
    RCCostBreakDown _cbd = _budget.getCbd();
    RCProject _project = _cbd.getProject();
    _project.setActualCostDirtyFlag(Boolean.valueOf(true));
    RCHasCostBudget _budget_1 = this.payRequest.getBudget();
    RCCostBreakDown _cbd_1 = _budget_1.getCbd();
    RCProject _project_1 = _cbd_1.getProject();
    RCProjectStat _stat = _project_1.getStat();
    _stat.updateInfo();
    Token __end___token = getProcessManager().forwardTo(token,"__end__");
    
  }
  
  public void financeManPay_agree(final String comment) {
    edu.fudan.langlab.domain.workflow.Token token = getProcessManager().assertToken(this,com.shrct.businessprocess.budget.RCHasCostBudgetPayProcessStatus.financeManPay.name());
    _financeManPay_agree(comment,token);
    systemExecute();
    String msg = getFinanceManPay_Agree_log_message(comment);
    getProcessManager().createActivity(this,"财务付款.财务同意付款",msg);
    
    
  }
  
  public String getFinanceManPay_Agree_log_message(final String comment) {
    String _xifexpression = null;
    boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(comment);
    if (_isNullOrEmpty) {
      _xifexpression = "";
    } else {
      String _plus = (",\u5907\u6CE8:" + comment);
      _xifexpression = _plus;
    }
    String _plus_1 = ("\u8D22\u7406\u540C\u610F\u4ED8\u6B3E" + _xifexpression);
    return _plus_1;
  }
  
  public void _financeManPay_refuse(final String comment, final Token token) {
    Token modify_token = getProcessManager().forwardTo(token,com.shrct.businessprocess.budget.RCHasCostBudgetPayProcessStatus.modify.name());
    getProcessManager().registTask(this, modify_token,saler(),getModify_task_message());
  }
  
  public void financeManPay_refuse(final String comment) {
    edu.fudan.langlab.domain.workflow.Token token = getProcessManager().assertToken(this,com.shrct.businessprocess.budget.RCHasCostBudgetPayProcessStatus.financeManPay.name());
    _financeManPay_refuse(comment,token);
    systemExecute();
    String msg = getFinanceManPay_Refuse_log_message(comment);
    getProcessManager().createActivity(this,"财务付款.财务不同意付款",msg);
    
    
  }
  
  public String getFinanceManPay_Refuse_log_message(final String comment) {
    String _xifexpression = null;
    boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(comment);
    if (_isNullOrEmpty) {
      _xifexpression = "";
    } else {
      String _plus = (",\u5907\u6CE8:" + comment);
      _xifexpression = _plus;
    }
    String _plus_1 = ("\u8D22\u52A1\u4E0D\u540C\u610F\u4ED8\u6B3E" + _xifexpression);
    return _plus_1;
  }
  
  public String getFinanceManPay_task_message() {
    String _entityName = this.budget.getEntityName();
    String _plus = ("\u8BA2\u5355\u7F16\u53F7" + _entityName);
    return _plus;
  }
  
  @JoinColumn(name = "budget_id")
  @ManyToOne(targetEntity = RCHasCostBudgetImpl.class, cascade = { CascadeType.MERGE, CascadeType.PERSIST })
  private RCHasCostBudget budget;
  
  public RCHasCostBudget getBudget() {
    return this.budget;
  }
  
  public RCHasCostBudgetPayProcess setBudget(final RCHasCostBudget budget) {
    this.budget = budget;
    return this;			
    
  }
  
  @JoinColumn(name = "payRequest_id")
  @ManyToOne(targetEntity = RCHasCostBudgetPayRequestImpl.class, cascade = { CascadeType.MERGE, CascadeType.PERSIST })
  private RCHasCostBudgetPayRequest payRequest;
  
  public RCHasCostBudgetPayRequest getPayRequest() {
    return this.payRequest;
  }
  
  public RCHasCostBudgetPayProcess setPayRequest(final RCHasCostBudgetPayRequest payRequest) {
    this.payRequest = payRequest;
    return this;			
    
  }
  
  @JoinColumn(name = "starter_id")
  @ManyToOne(targetEntity = RCEmployeeImpl.class, cascade = { CascadeType.MERGE, CascadeType.PERSIST })
  private RCEmployee starter;
  
  public RCEmployee getStarter() {
    return this.starter;
  }
  
  public RCHasCostBudgetPayProcess setStarter(final RCEmployee starter) {
    this.starter = starter;
    return this;			
    
  }
  
  public boolean _systemExecute() {
    boolean stateChanged = false;
    return stateChanged;
  }
  
  public static RCHasCostBudgetPayProcess create(final IObjectFactory objectFactory) {
    com.shrct.businessprocess.budget.RCHasCostBudgetPayProcess rCHasCostBudgetPayProcess = new com.shrct.businessprocess.budget.impl.RCHasCostBudgetPayProcessImpl();
    objectFactory.create(rCHasCostBudgetPayProcess);
    return rCHasCostBudgetPayProcess;			
    
  }
  
  public Party saler() {
    return this.starter;
  }
  
  public Party businessMan() {
    RCCostBreakDown _cbd = this.budget.getCbd();
    RCProject _project = _cbd.getProject();
    RCEmployee _businessMan = _project.getBusinessMan();
    return _businessMan;
  }
  
  public Party ceo() {
    RCEmployee _xblockexpression = null;
    {
      BeanFactory _beanFactory = this.getBeanFactory();
      RCCEORoleProvider _bean = _beanFactory.<RCCEORoleProvider>getBean(RCCEORoleProvider.class);
      final RCEmployee res = _bean.getParty();
      boolean _notEquals = (!Objects.equal(res, null));
      Validates.Assert(_notEquals, "\u672A\u8BBE\u7F6E\u603B\u7ECF\u7406");
      _xblockexpression = (res);
    }
    return _xblockexpression;
  }
  
  public Party financeLeader() {
    RCEmployee _xblockexpression = null;
    {
      BeanFactory _beanFactory = this.getBeanFactory();
      RCFinanceLeaderRoleProvider _bean = _beanFactory.<RCFinanceLeaderRoleProvider>getBean(RCFinanceLeaderRoleProvider.class);
      final RCEmployee res = _bean.getParty();
      boolean _notEquals = (!Objects.equal(res, null));
      Validates.Assert(_notEquals, "\u672A\u8BBE\u7F6E\u8D22\u52A1\u7ECF\u7406");
      _xblockexpression = (res);
    }
    return _xblockexpression;
  }
  
  public Party financeMan() {
    RCEmployee _xblockexpression = null;
    {
      BeanFactory _beanFactory = this.getBeanFactory();
      RCFinanceManRoleProvider _bean = _beanFactory.<RCFinanceManRoleProvider>getBean(RCFinanceManRoleProvider.class);
      final RCEmployee res = _bean.getParty();
      boolean _notEquals = (!Objects.equal(res, null));
      Validates.Assert(_notEquals, "\u672A\u8BBE\u7F6E\u51FA\u7EB3\u8D22\u52A1");
      _xblockexpression = (res);
    }
    return _xblockexpression;
  }
  
  public RCHasCostBudgetPayProcessProxy toProxy() {
    com.shrct.businessprocess.budget.proxy.RCHasCostBudgetPayProcessProxy proxy = new com.shrct.businessprocess.budget.proxy.RCHasCostBudgetPayProcessProxy();
    proxy.setId(this.getId());
    if(this instanceof edu.fudan.mylang.pf.INamedModelObject){
    	proxy.setName(((edu.fudan.mylang.pf.INamedModelObject)this).getEntityName());
    }
    return proxy;
    
  }
}
